# -*- coding: utf-8 -*-
from douban.items import CommentItem
import scrapy


class MovieCommentSpider(scrapy.Spider):
    name = 'movieSpider'
    allowed_domains = ['movie.douban.com']
    start_urls = ['https://movie.douban.com/subject/34841067/comments']
    def parse(self, response):
        subSelector = response.xpath("//span[ @class ='short']")
        items=[]
        for sub in subSelector:
            item = CommentItem()
            item['content'] = sub.extract()
            items.append(item)
        return items